﻿<%@ Page Language="C#" MasterPageFile="~/admin/MasterPage.master" AutoEventWireup="true" CodeFile="AccountNguoiDung.aspx.cs" Inherits="admin_Default2" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="phContent" Runat="Server">
 <form id="Form1" runat="server" action="">
        <h3 style="text-align:center">Danh Sách Các User</h3>
        <asp:GridView runat="server" ID="grdUser" DataKeyNames="ID" AutoGenerateColumns="False" 
                      AllowPaging="True" PageSize="10" OnPageIndexChanging="grdUser_PageIndexChanging" 
                      Height="250px" HorizontalAlign="Center"  OnRowCommand="grdUser_RowCommand" OnSelectedIndexChanged="grdUser_SelectedIndexChanged" >
             <Columns>
                  <asp:TemplateField HeaderText="Tên User">
                    <ItemTemplate> 
                        <asp:Label ID="lblUserName" runat="server" Text='<%# Bind("username") %>'></asp:Label> 
                    </ItemTemplate>
                     <HeaderStyle HorizontalAlign="Left" />
                  </asp:TemplateField>
                  <asp:TemplateField HeaderText="Họ Tên">
                    <ItemTemplate> 
                        <asp:Label ID="lblName" runat="server" Text='<%# Bind("name") %>'></asp:Label> 
                    </ItemTemplate>
                     <HeaderStyle HorizontalAlign="Left" />
                  </asp:TemplateField>
                  <asp:TemplateField HeaderText="Email">
                    <ItemTemplate> 
                        <asp:Label ID="lblEmail" runat="server" Text='<%# Bind("email") %>'></asp:Label> 
                    </ItemTemplate>
                     <HeaderStyle HorizontalAlign="Left" />
                  </asp:TemplateField>
                  <asp:TemplateField HeaderText="Loại user">
                    <ItemTemplate> 
                        <asp:Label ID="lblTypeName" runat="server" Text='<%# Bind("type_name") %>'></asp:Label> 
                    </ItemTemplate>
                     <HeaderStyle HorizontalAlign="Left" Width="70px"/>
                  </asp:TemplateField>  
                  <asp:TemplateField HeaderText="Mobiphone">
                    <ItemTemplate> 
                        <asp:Label ID="lblMobilePhone" runat="server" Text='<%# Bind("mobile_phone") %>'></asp:Label> 
                    </ItemTemplate>
                     <HeaderStyle HorizontalAlign="Left" Width="70px"/>
                  </asp:TemplateField> 
                  <asp:TemplateField HeaderText="Tình Trạng">                    
                    <ItemTemplate>                                                     
                        <asp:LinkButton ID="lnkActive" CommandName="Active" CommandArgument='<%#Eval("ID") %>' runat="server" Text='<%# Bind("activation") %>'></asp:LinkButton>                     
                    </ItemTemplate>                    
                    <ControlStyle CssClass="center"/>                   
                  </asp:TemplateField>        
                  <asp:TemplateField HeaderText="Xóa">
                    <ItemTemplate>
                        <asp:LinkButton ID="lnkDelete" CommandName='Xoá' OnClientClick="return confirm('Bạn có chắc muốn xóa user này không ?')" CommandArgument='<%#Eval("ID")%>' runat="server">Xoá</asp:LinkButton>
                    </ItemTemplate>                   
                  </asp:TemplateField> 
                  <asp:TemplateField HeaderText="Sửa">
                    <ItemTemplate>
                        <a href="./SuaUser.aspx?id=<%#Eval("ID")%>" >Sửa</a>
                    </ItemTemplate>                   
                  </asp:TemplateField>                                 
             </Columns>
        </asp:GridView>        
    </form>    
</asp:Content>

